<?php

namespace App\Http\Controllers;

use App\Models\Config;
use Illuminate\Http\Request;

class SiteController extends Controller
{
    public function index()
    {
        // 跳转 admin 页面
        return redirect('/admin');
    }

    public function screen()
    {

        $configs = Config::get();

        $data = [];
        foreach ($configs as $item) {
            $data[$item->key] = [
                'status' => $item->status,
                'value' => $item->value,
            ];
        }

        return view('screen', [
            'data' => $data,
        ]);
    }
}
